﻿#pragma  once

#include "datatable.h"
#include "TableReader.h"
#include "cocos2d.h"

USING_NS_CC;

//配置文件单例
//需要在init()方法中初始化
class TableMgr
{
public:
	TableMgr();
	~TableMgr();

	static TableMgr* getInstance();	

	void init();
	
private:

	CC_SYNTHESIZE_READONLY(TestDataOneTable*, _testdataonetable, DataOneTable);
	CC_SYNTHESIZE_READONLY(GameEffectTable*, _gameffectable, EffectTable);
	CC_SYNTHESIZE_READONLY(GameMusicTable*, _gamemusictable, MusicTable);
	CC_SYNTHESIZE_READONLY(UTFtestTable*, _UTFtable, UTFTable);
	CC_SYNTHESIZE_READONLY(GBtestTable*, _GBtable, GBTable);

};

#define GET_TestTable TableMgr::getInstance()->getDataOneTable()               //测试表
#define GET_MusicTable TableMgr::getInstance()->getMusicTable()                   //音乐表
#define GET_EffectTable TableMgr::getInstance()->getEffectTable()                    //音效表
#define GET_UTFTable TableMgr::getInstance()->getUTFTable()
#define GET_GBTable TableMgr::getInstance()->getGBTable()